how to count characters in text file